﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using System.Xml.Serialization;

namespace DevelopStudio.Basic
{
    [Serializable]
    [XmlRoot("Root")]
    public class MemberInfo
    {
        public MemberInfo()
        {
            Init();
        }

        private void Init()
        {
            ID = string.Empty;
            Name = string.Empty;
            Email = string.Empty;
            CodeReviewFrequency = 0;
            ResolvedFrequency = 0;
            OwnerProjects = new List<Guid>();
        }

        [XmlElement("ID")]
        public string ID { get; set; }

        [XmlElement("Name")]
        public string Name { get; set; }

        [XmlElement("Email")]
        public string Email { get; set; }

        public int CodeReviewFrequency { get; set; }

        public void AutoCodeReviewFrequency()
        {
            ++this.CodeReviewFrequency;
        }

        public int ResolvedFrequency { get; set; }

        public void AutoResolvedFrequency()
        {
            ++this.ResolvedFrequency;
        }

        public List<Guid> OwnerProjects { get; set; }

        [XmlIgnore]
        public bool Enabled { get; set; }
    }
}
